//
//  ShellLanguageCell.m
//  ShellWallert
//
//  Created by lvzhao on 2019/5/14.
//  Copyright © 2019 吕VV. All rights reserved.
//

#import "ShellLanguageCell.h"


@interface ShellLanguageCell()

@property (nonatomic,strong) UILabel *titleLabel;



@end


@implementation ShellLanguageCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = COLOR_TINT;
        [self setupView];
    }
    return self;
}


#pragma mark - setupView
- (void)setupView{
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(55);
    }];
    
    [self.contentView addSubview:self.selectImgView];
    [self.selectImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.right.mas_equalTo(-15);
        make.width.mas_equalTo(22);
        make.height.mas_equalTo(22);
    }];
    
    self.bottomLineView.hidden = NO;
    self.bottomLineView.backgroundColor = RGBA(102, 153, 191, 0.2);
    [self.bottomLineView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.width.mas_equalTo(K_SCREENWIDTH -30);
        make.bottom.mas_equalTo(0);
        make.height.mas_equalTo(1);
    }];
}



#pragma mark - get && set
- (void)setModelObject:(id)modelObject{
    self.titleLabel.text = modelObject;
}




- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel lz_createLabWithTextColor:UIColorHex(0xFFFFFF) font:k_textFont(16)];
    }
    return _titleLabel;
}


- (UIImageView *)selectImgView{
    if (!_selectImgView) {
        _selectImgView = [[UIImageView alloc] initWithImage:k_imageName(@"state_selected")];
        _selectImgView.hidden = YES;
    }
    return _selectImgView;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
